﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using Microsoft.SharePoint;

using KoEventReceiver_Shops_ExList_ListItem_2.EventReceiver1;

namespace KoEventReceiver_Shops_ExList_ListItem_2_WinForms_Test
{

    public partial class Form1 : Form
    {

        public Form1()
        {
            InitializeComponent();
        }

        private void testToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            
        }

        private void setRightToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //string ListName = "Кассовые документы";
            string ListName = "Первичные документы";

            using (SPSite site = new SPSite(@"http://localhost/sites/shop/"))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPList list = web.Lists[ListName];
                    SPListItem item = list.Items[0];
                    Ko2.Portal.Right.PermDocRight.PermDocs_SetRoleItem(item);
                    //Ko2.Portal.Right.TillDocRight.TillDocs_SetRoleItem(item);
                }
            }
        }
    }
}
